set(SERIALIZER_TARGET ncnn-serializer)
FILE(GLOB_RECURSE NCNN_SRCS "*.cpp")

ADD_LIBRARY(${SERIALIZER_TARGET} SHARED ${NCNN_SRCS}) 
target_link_libraries(${SERIALIZER_TARGET} ${TENGINE_LIBRARY} )
SET_TARGET_PROPERTIES(${SERIALIZER_TARGET} PROPERTIES VERSION ${SERIALIZER_VERSION} SOVERSION ${SERIALIZER_SO_VERSION})
install(TARGETS ${SERIALIZER_TARGET} DESTINATION lib)

#below is for static library
if (CONFIG_BUILD_CONVERT_TOOLS)
    ADD_LIBRARY(${SERIALIZER_TARGET}-static STATIC ${NCNN_SRCS})
    SET_TARGET_PROPERTIES(${SERIALIZER_TARGET}-static PROPERTIES OUTPUT_NAME  ${SERIALIZER_TARGET})
    ADD_DEPENDENCIES(${SERIALIZER_TARGET} ${SERIALIZER_TARGET}-static)
    install(TARGETS ${SERIALIZER_TARGET}-static DESTINATION lib)
endif()